package com.hacoc.countdown.model;

import java.io.Serializable;
import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/** 
 *        @hibernate.class
 *         table="tag_type"
 *     
*/
public class TagType implements Serializable {

    /** identifier field */
    private String tagId;

    /** nullable persistent field */
    private String tagName;

    /** nullable persistent field */
    private Integer clicks;

    /** nullable persistent field */
    private String remarks;

    /** persistent field */
    private Set countDowns;

    /** full constructor */
    public TagType(String tagId, String tagName, Integer clicks, String remarks, Set countDowns) {
        this.tagId = tagId;
        this.tagName = tagName;
        this.clicks = clicks;
        this.remarks = remarks;
        this.countDowns = countDowns;
    }

    /** default constructor */
    public TagType() {
    }

    /** minimal constructor */
    public TagType(String tagId, Set countDowns) {
        this.tagId = tagId;
        this.countDowns = countDowns;
    }

    /** 
     *            @hibernate.id
     *             generator-class="assigned"
     *             type="java.lang.String"
     *             column="tag_id"
     *         
     */
    public String getTagId() {
        return this.tagId;
    }

    public void setTagId(String tagId) {
        this.tagId = tagId;
    }

    /** 
     *            @hibernate.property
     *             column="tag_name"
     *             length="30"
     *         
     */
    public String getTagName() {
        return this.tagName;
    }

    public void setTagName(String tagName) {
        this.tagName = tagName;
    }

    /** 
     *            @hibernate.property
     *             column="clicks"
     *             length="11"
     *         
     */
    public Integer getClicks() {
        return this.clicks;
    }

    public void setClicks(Integer clicks) {
        this.clicks = clicks;
    }

    /** 
     *            @hibernate.property
     *             column="remarks"
     *             length="100"
     *         
     */
    public String getRemarks() {
        return this.remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="tag_id"
     *            @hibernate.collection-one-to-many
     *             class="com.hacoc.countdown.model.CountDown"
     *         
     */
    public Set getCountDowns() {
        return this.countDowns;
    }

    public void setCountDowns(Set countDowns) {
        this.countDowns = countDowns;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("tagId", getTagId())
            .toString();
    }

    public boolean equals(Object other) {
        if ( (this == other ) ) return true;
        if ( !(other instanceof TagType) ) return false;
        TagType castOther = (TagType) other;
        return new EqualsBuilder()
            .append(this.getTagId(), castOther.getTagId())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getTagId())
            .toHashCode();
    }

}
